import { useEffect } from 'react'
import styles from './index.css'
import Header from '@/components/header'
// import wx from 'weixin-js-sdk'
import axios from 'axios'

// React.Component.prototype.$md5 = md5
const BasicLayout = (props) => {
  useEffect(() => {
    axios.post('http://www.ec-china.com:8087/shebaoWX/wechat/wxConfig', {})
        .then(response => console.log('response', response))
        .catch(error => console.log('error', error))
  }, [])
  const current = props.route.routes.find(i => i.path === props.location.pathname)
  return (
    <div className={styles.normal}>
      <Header current={current} history={props.history} />
      {props.children}
    </div>
  )
}

export default BasicLayout
